function Person(name){
    this.name = name
}

let p1 = new Person('张三')
console.log("p1",p1);

/**
 * 使用 class 关键字定义 类型
 */
class Student{
    // name = '';
    // age = 0;


   static pi = 3.14;

    //构造器不能有多个
    //构造器
    constructor(name , age = 0 ){
        this.name = name;
        this.age = age
    }

    sayHi(){
       console.log(`姓名:${this.name} 年龄 ${this.age}`);
       
    }


    static max(numa ,numb){
        return numa> numb?numa:numb
    }

}


let stu1 = new Student("关云长",50);
let stu2 = new Student("赵云",48);
let stu3 = new Student("刘备");
console.log("stu1",stu1);
console.log("stu2",stu2);
console.log("stu3",stu3);

stu1.sayHi()
stu2.sayHi()
stu3.sayHi()



// Math.max(100,300)

console.log("Student.pi, "+Student.pi);


console.log("Student.max(100,200):"+Student.max(100,200));
console.log("stu1.max(300,500):"+stu1.max(300,500));

